﻿using System;

class FindTrailingZeros
{
    static void Main()
    {
        Console.WriteLine("A program that calculates the trailing zeros of N!.");
        Console.Write("Enter a positive integer number N: ");
        string consoleInput = Console.ReadLine();
        int n;
        int.TryParse(consoleInput, out n);

        if (n > 0)
        {
            int count = 0;
            for (int i = 5; i <= n; i *= 5)
            {
                count += n / i; //sum of n/5 + n/25 + n/125 + …
            }
            if (count > 0)
            {
                Console.WriteLine("There are [{0}] trailing zeros at the end of the number N!.", count);
            }
            else
            {
                Console.WriteLine("There is no trailing zeros at the end of the number N!.");
            }
        }
        else
        {
            
            Console.WriteLine("Invalid value!");
        }
    }
}
